<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>刷脸认证结果</title>
    <script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
    <style>
        .back-btn-container{
            width: 100%;
            height: 15vh;
            flex-direction: column;
        }
    </style>
</head>
<script type="text/javascript" th:inline="javascript">
    const rspMsg = [[${rspMsg}]]
</script>
<body>
<div data-role="page">
    <textarea id="jsonString" rows="10" cols="50"></textarea>
    <br><br>
    <div class="back-btn-container ">
        <button onclick="copyJsonString()">复制</button>
    </div>

</div>

</body>
<script>
    let obj = JSON.parse(rspMsg);
    let prettyJSON = "";
    if(obj.code == "0000"){
        let resContent = JSON.parse(obj.bizContent)
        obj.bizContent = resContent;
        prettyJSON = JSON.stringify(obj, undefined, 4);
        document.getElementById("jsonString").value = prettyJSON;
    }else{
        prettyJSON = JSON.stringify(obj, undefined, 4);
        document.getElementById("jsonString").value = prettyJSON;
    }

    function copyJsonString() {
        const jsonString = document.getElementById("jsonString");
        jsonString.select();
        document.execCommand("copy");
        alert("复制: " + jsonString.value);
    }
</script>
</html>